cmake_minimum_required(VERSION 3.10)

# 
project(serialib VERSION 1.0 LANGUAGES CXX)

# 
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_C_FLAGS_RELEASE "-O3")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")

# 可执行文件
include_directories(include)

file(GLOB HEADERS "./*.h")
file(GLOB SOURCES "./*.cpp")

add_library(serialib SHARED 
    ${SOURCES}
)

target_compile_options(serialib PRIVATE $<$<CONFIG:Release>:-O3>)

# install
install(TARGETS serialib DESTINATION lib)
install(FILES ${HEADERS} DESTINATION include)
